package com.zhima.properties;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * @author : Administer
 * @date : 2023-09-07 08:16
 **/
@Data
@Configuration
@ConfigurationProperties("zhima-oj-judge0")
public class Judge0Properties implements InitializingBean {
    public static String JUDGE0_URL;
    private String host;
    private Integer port;
    /**
     * 认证的token
     */
    private String authenticationToken;
    /**
     * 授权的token
     */
    private String authorizationToken;

    @Override
    public void afterPropertiesSet() throws Exception {
        JUDGE0_URL = String.format("http://%s:%s", host, port);
    }
}
